﻿using System;
using System.Windows.Automation;

namespace QuickUIT.Controls
{
    /// <summary>
    /// Represents a calendar (date time picker) control.  
    /// </summary>
    public class UICalendar : UIBaseControl
    {
        /// <summary>
        /// Gets the number of rows in the date time picker. 
        /// </summary>
        public new int RowCount
        {
            get { return base.RowCount; }
        }

        /// <summary>
        /// Gets the number of columns in the date time picker. 
        /// </summary>
        public new int ColumnCount
        {
            get { return base.ColumnCount; }
        }

        /// <summary>
        /// Gets a value which indicates the primary direction of traversal for a table type control.
        /// If the control does not support the <see cref="TablePattern"/> , a null reference is returned.
        /// </summary>
        public new RowOrColumnMajor? RowOrColumnMajor
        {
            get { return base.RowOrColumnMajor; }
        }

        /// <summary>
        /// Gets the current control specific view. 
        /// </summary>
        public new int CurrentView
        {
            get { return base.CurrentView; }   
        }

        /// <summary>
        /// Gets a value which indicates if the control allows more than one child element to be selected concurrently. 
        /// </summary>
        public new bool CanSelectMultiple
        {
            get { return base.CanSelectMultiple; }
        }

        /// <summary>
        /// Gets a value which indicates if the control requires at least one child element to be selected. 
        /// </summary>
        public new bool IsSelectionRequired
        {
            get { return base.IsSelectionRequired; }
        }

        /// <summary>
        /// Gets a value which indicates whether the control can scroll horizontally. 
        /// </summary>
        public new bool HorizontallyScrollable
        {
            get { return base.HorizontallyScrollable; }
        }

        /// <summary>
        /// Gets a value which indicates whether the control can scroll horizontally. 
        /// </summary>
        public new bool VerticallyScrollable
        {
            get { return base.VerticallyScrollable; }
        }

        /// <summary>
        /// Gets the value of the horizontal scroll position.
        /// If the control does not support the <see cref="ScrollPattern"/>, returns NaN. 
        /// </summary>
        public new double HorizontalScrollPercent
        {
            get { return base.HorizontalScrollPercent; }
        }

        /// <summary>
        /// Gets the value of the vertical scroll position.
        /// If the control does not support the <see cref="ScrollPattern"/>, returns NaN.
        /// </summary>
        public new double VerticalScrollPercent
        {
            get { return base.VerticalScrollPercent; }
        }

        /// <summary>
        /// Gets the value of the horizontal size of the viewable region.
        /// If the control does not support the <see cref="ScrollPattern"/>, returns NaN.
        /// </summary>
        public new double HorizontalViewSize
        {
            get { return base.HorizontalViewSize; }
        }

        /// <summary>
        /// Gets the value of the vertical size of the viewable region.
        /// If the control does not support the <see cref="ScrollPattern"/>, returns NaN.
        /// </summary>
        public new double VerticalViewSize
        {
            get { return base.VerticalViewSize; }
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="UICalendar"/> class. 
        /// </summary>
        public UICalendar() : base(ControlType.Calendar)
        {
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="UICalendar"/> class.
        /// </summary>
        /// <param name="parent">The parent of this control.</param>
        public UICalendar(UIBaseControl parent) : base(parent, ControlType.Calendar)
        {
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="UICalendar"/> class.
        /// </summary>
        /// <param name="locator">The locator used to find the specific control.</param>
        public UICalendar(string locator) : base(null, ControlType.Calendar, locator)
        {
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="UICalendar"/> class.
        /// </summary>
        /// <param name="parent">The parent of this control.</param>
        /// <param name="locator">The locator used to find the specific control.</param>
        public UICalendar(UIBaseControl parent, string locator) : base(parent, ControlType.Calendar, locator)
        {
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="UICalendar"/> class.
        /// </summary>
        /// <param name="control">The underlying <see cref="AutomationElement"/> of the control.</param>
        public UICalendar(AutomationElement control) : base(control, ControlType.Calendar)
        {
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="UICalendar"/> class.
        /// </summary>
        /// <param name="parent">The parent of the control</param>
        /// <param name="control">The underlying <see cref="AutomationElement"/> of the control.</param>
        public UICalendar(UIBaseControl parent, AutomationElement control) : base(parent, control, ControlType.Calendar)
        {
        }

        /// <summary>
        /// Retrieves an element that represents the specified cell in a calendar control. 
        /// </summary>
        /// <param name="row">The ordinal number of the row of interest.</param>
        /// <param name="col">The ordinal number of the column of interest.</param>
        /// <returns>The <see cref="AutomationElement"/> that represents the retrieved cell.</returns>
        /// <exception cref="InvalidOperationException">The control pattern cannot be performed by the element.</exception>
        /// <exception cref="ElementNotAvailableException">The element is not available anymore.</exception>
        public new AutomationElement GetItem(int row, int col)
        {
            return base.GetItem(row, col); 
        }

        /// <summary>
        /// Gets a collection of elements that represents the current selection for an element.
        /// </summary>
        /// <returns>A collection of selected elements.</returns>
        /// <exception cref="InvalidOperationException">The control pattern cannot be performed by the element.</exception>
        /// <exception cref="ElementNotAvailableException">The element is not available anymore.</exception>
        public new AutomationElement[] GetSelection()
        {
            return base.GetSelection(); 
        }

        /// <summary>
        /// Gets a collection of elements that represents all the column headers in a table.
        /// </summary>
        /// <returns>A collection of elements representing the column headers.</returns>
        /// <exception cref="InvalidOperationException">The control pattern cannot be performed by the element.</exception>
        /// <exception cref="ElementNotAvailableException">The element is not available anymore.</exception>
        public new AutomationElement[] GetColumnHeaders()
        {
            return base.GetColumnHeaders();
        }

        /// <summary>
        /// Gets a collection of automation elements that represents all the row headers in a table.
        /// </summary>
        /// <returns>A collection of elements representing the row headers.</returns>
        /// <exception cref="InvalidOperationException">The control pattern cannot be performed by the element.</exception>
        /// <exception cref="ElementNotAvailableException">The element is not available anymore.</exception> 
        public new AutomationElement[] GetRowHeaders()
        {
            return base.GetRowHeaders();
        }

        /// <summary>
        /// Sets the current control specific view. 
        /// </summary>
        /// <param name="viewId">The view identifier to set.</param>
        /// <exception cref="InvalidOperationException">The control pattern cannot be performed by the element.</exception>
        /// <exception cref="ElementNotAvailableException">The element is not available anymore.</exception>
        public new void SetCurrentView(int viewId)
        {
            base.SetCurrentView(viewId);
        }

        /// <summary>
        /// Scrolls the visible region of the content area horizontally and vertically. 
        /// </summary>
        /// <param name="horizontalAmount">The horizontal scrolling increment that is specific to the control.</param>
        /// <param name="verticalAmount">The vertical scrolling increment that is specific to the control.</param>
        /// <exception cref="InvalidOperationException">The control pattern cannot be performed by the element.</exception>
        /// <exception cref="ElementNotAvailableException">The element is not available anymore.</exception>
        /// <remarks>No scroll should be passed if if the control cannot be scrolled in a given direction.</remarks>
        public new void Scroll(ScrollAmount horizontalAmount, ScrollAmount verticalAmount)
        {
            base.Scroll(horizontalAmount, verticalAmount);
        }

        /// <summary>
        /// Scrolls the visble region of the content area vertically by a <see cref="ScrollAmount"/>.
        /// </summary>
        /// <param name="amount">The vertical scrolling increment.</param>
        public new void ScrollVertically(ScrollAmount amount)
        {
            base.ScrollVertically(amount);
        }

        /// <summary>
        /// Scrolls the visble region of the content area horizontally by a <see cref="ScrollAmount"/>.
        /// </summary>
        /// <param name="amount">The horizontal scrolling increment.</param>
        public new void ScrollHorizontally(ScrollAmount amount)
        {
            base.ScrollHorizontally(amount);
        }

        /// <summary>
        /// Sets the horizontal and vertical scroll position as a percentage of the total content area within the control. 
        /// </summary>
        /// <param name="horizontalPercent">
        /// The percentage of the total horizontal content area. 
        /// <see cref="ScrollPattern.NoScroll"/> should be passed in if the control cannot be scrolled in this direction.
        /// </param>
        /// <param name="verticalPercent">
        /// The percentage of the total vertical content area. 
        /// <see cref="ScrollPattern.NoScroll"/> should be passed in if the control cannot be scrolled in this direction.
        /// </param>
        public new void SetScrollPercent(double horizontalPercent, double verticalPercent)
        {
            base.SetScrollPercent(horizontalPercent, verticalPercent);
        }

        /// <summary>
        /// Retrieves a collection of integer values that identify the views available for a control.
        /// </summary>
        /// <returns>A collection of view identifiers. An empty collection is returned if there are no found view identifiers.</returns>
        /// <exception cref="InvalidOperationException">The control pattern cannot be performed by the element.</exception>
        /// <exception cref="ElementNotAvailableException">The element does is not available anymore.</exception>
        public new int[] GetSupportedViews()
        {
            return base.GetSupportedViews();
        }
    }
}
